﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/layui/css/layui.css" />
<title>文章列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 分类管理 <span class="c-gray en">&gt;</span> 文档管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="l">
			<a href="javascript:;" onclick="dels('{$model['id']}')" class="btn btn-danger radius">
				<i class="Hui-iconfont">&#xe6e2;</i> 批量删除
			</a>
				<a href="javascript:;" onclick="articlecon_add('添加','{:url('danbiao/show_add')}?modelid={$model['id']}','800','700')" class="btn btn-primary radius">
				<i class="Hui-iconfont">&#xe600;</i> 添加{$model['model_name']}
			</a>
		</span> 
		<span class="r">共有数据：<strong></strong> 条</span>
	</div>
	<br/>
	<table class="table table-border table-bordered table-bg">
		<thead>
			{php}echo $head;{/php}
		</thead>
		<tbody>
		{php}echo $tbody;{/php}
		</tbody>
	</table>
	<div style="text-align: center">
		<div id="test1"></div>
	</div>

</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__ADMIN__/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__ADMIN__/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="__ADMIN__/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__ADMIN__/layui/layui.all.js"></script>
<script type="text/javascript" src="__ADMIN__/js/maowenke.js"></script>
<script type="text/javascript">
	function info(title,id,w,h) {
		layer_shows(title,"{:url('info/show')}?id="+id,w,h);
    }
//	function art_info(title,id,w,h) {
//		layer_shows(title,"{:url('info/art')}?id="+id,w,h);
//    }
//    layui.use('laypage', function(){
//        var laypage = layui.laypage;
//
//        //执行一个laypage实例
//        laypage.render({
//            elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
//            ,count: parseInt(50) //数据总数，从服务端得到
//            ,jump:function (obj,first) {
//            }
//        });
//    });

/*类容-增加*/
function articlecon_add(title,url,w,h){
	layer_show(title,url,w,h,function () {
		window.location.reload();
    });
}
/*类容-删除*/
function del(obj,id,modelid){
	layer.confirm('确认要删除吗？',function(index){
        ajaxUpdate('{:url("danbiao/del")}',{id:id,modelid:modelid},'true','post',function (data) {
            console.log(data);
            if(data==1){
                layer.msg('删除成功');
                $(obj).parents('tr').remove();
            }else{
                layer.msg(data);
            }
        })
	});
}

/*类容-编辑*/
function articlecon_edit(title,url,w,h){
	layer_show(title,url,w,h,function () {
		window.location.reload();
    });
}


    /**
     * 批量删除内容
     */
    function dels(modelid) {
    var $input = $("input[name=userid]");
    var idarr = [];
    $.each($input,function (i,v) {
        if($(v).prop('checked')){
            idarr.push($(v).val());
        }
    });
        layer.confirm('确认要删除吗？',function(index){
            ajaxUpdate('{:url("danbiao/del")}',{id:idarr,modelid:modelid},'true','post',function (data) {
                console.log(data);
                if(data==1){
                    for (var a=0;a<idarr.length;a++){
                        $("input[value="+idarr[a]+"]").parents('tr').remove();
                    }
                    layer.msg('删除成功');
                }else{
                    layer.msg(data);
                }
            })
        });
}
</script>
</body>
</html>